package com.weipai.education.mapper;

import com.weipai.education.model.Purchase;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface PurchaseMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Purchase record);

    int insertSelective(Purchase record);

    Purchase selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Purchase record);

    int updateByPrimaryKey(Purchase record);

    List<Map<String,Object>> list(@Param("start") Integer start, 
                                  @Param("end") Integer size, 
                                  @Param("startTime") String startTime, 
                                  @Param("endTime") String endTime, 
                                  @Param("key") String key, 
                                  @Param("userId") String userId,
                                  @Param("type") String type,
                                  @Param("status") String status);

    Integer listAmount(@Param("startTime") String startTime, 
                       @Param("endTime") String endTime, 
                       @Param("key") String key, 
                       @Param("userId") String userId, 
                       @Param("type") String type,
                       @Param("status") String status);

    Purchase getPurchaseByPurchaseNumber(String purchaseNumber);

    Map<String,Object> getPurchaseInfo(String purchaseNumber);

    List<Map<String,Object>> getWeekPurchase(@Param("start") Integer start, 
                                             @Param("end") Integer size, 
                                             @Param("userId") String userId);

    List<Map<String,Object>> getMonthPurchase(@Param("start") Integer start, 
                                              @Param("end") Integer size, 
                                              @Param("userId") String userId);

    List<Map<String,Object>> getDayPurchase(@Param("userId") String userId);

    Integer getWeekPurchaseAmount(@Param("userId") String userId);

    Integer getMonthPurchaseAmount(@Param("userId") String userId);

    Integer getDayPurchaseAmount(@Param("userId") String userId);

    Map<String,Object> getAllAmount(@Param("userId") String userId);

    List<Map<String,Object>> cityLevelList(@Param("start") Integer start, 
                                           @Param("end") Integer size, 
                                           @Param("startTime") String startTime, 
                                           @Param("endTime") String endTime, 
                                           @Param("key") String key, 
                                           @Param("idList") List<Integer> idList);

    Integer cityLevelListAmount(@Param("startTime") String startTime, 
                                @Param("endTime") String endTime, 
                                @Param("key") String key, 
                                @Param("idList") List<Integer> idList);

    Map<String,Object> searchOrderByOrderNumber(@Param("OrderNumber") String OrderNumber,
                                      @Param("userId") Integer userId);
}